#!/bin/bash

# Load external functions and the test definitions
source sharedfunctions.sh
source testdefinitions.sh

# This function iterates around the tests in the TESTS_A variable and
# runs each test multiple times (as defined by the TESTSCOUNT_A variable)
function runalltests
{
  for ((t=0; t<${#TESTS_A[@]}; t++));do
	TESTLABEL=${TESTS_A[$t]}
	RUNS=${TESTSCOUNT_A[$t]}
	for ((r=1; r<=$RUNS; r++)); do
          # Don't setup test variables because we want each file to have its own date: # setuptestvariables
	  createexperiment
	  $TESTLABEL
	  $CLEANUP && deleteexperiment
	done
  done
}

# Main body of script
setupvariables
createtimestampexe
$PRINTHEADER && printheader
runalltests
deletetimestampexe
